﻿module UI {

    export class UIControl {

        public type: string = 'Unknown';

        public name: string = null;

        public tag: any = null;

        public transparent: boolean = false;

        public enabled: boolean = true;

        public visible: boolean = true;

        public computed: ComputedState = null;

        public left: number = undefined;

        public top: number = undefined;

        public width: number = undefined;

        public height: number = undefined;

        public right: number = undefined;

        public bottom: number = undefined;

        public controls: Array<UIControl> = [];

        public onClick: InputEvent = undefined;

        public onKeyDown: InputEvent = undefined;

        public onEnter: InputEvent = undefined;

        public onExit: InputEvent = undefined;

        constructor() {
            this.computed = new ComputedState();
        }

        handleKeyDown: InputEvent = undefined;

        handleKeyPress: InputEvent = undefined;

        handleKeyUp: InputEvent = undefined;

        handleClick: InputEvent = undefined;

        public render(context: CanvasRenderingContext2D): void { }        

    }

} 